All Questions
Tagged with entity-frameworkasp.net-core
21 questions
2votes
2answers
113views
Could concurrent user-triggered data fetches and inserts lead to deadlocks in a multi-user ASP.NET Core + MSSQL application?
I'm facing a tricky situation that might result from a not thoroughly thought-out design, and I'm hoping to understand whether a deadlock might be a realistic cause – and if so, how to prevent similar ...
1vote
3answers
149views
Are there non-inheritance-chain-mess ways to make modular libraries that rely on Entity Framework based on one DB context in the using project?
I am developing some modular libraries that contain common APIs, data, and functionality. One of the core assumptions to these libraries is you would use which you want to compose your project, but ...
-1votes
1answer
662views
REST API designing resources for complex entities
I have an ASP.Net Core Web API where I am having difficulties designing the REST resources based on the EF Entities I have. There are three entities that describe a Reservation. First, there is the ...
0votes
1answer
34views
Getting sums of multiple leveled relations efficiently
I'm currently building an API and a web app for an internal warehouse system using NET Core. I have the core entity structure, that goes like this: "Material" has many "MaterialSubtypes&...
0votes
1answer
2kviews
Right way of folder structure in MVC Project
I'm building a project with C# AspNet.Mvc. I'm using Entity Framework Core. It has Poco which maps in data from DB. On Mvc project itself i've got ViewModels folder where i have models topass between ...
-1votes
1answer
133views
Strategy to make sure relevant cache records are expired on data update
In our database, we have around 150 different tables. However, there are a handful of them that are key, as in they get referenced pretty much everywhere. We also have quite a few reports that we pull ...
1vote
1answer
527views
Designing asp.net core web api to add sub classes/specialized objects
I have not worked with EF for a while. As an exercise, I am writing a core web api that allows keeping track of a user medias. A media can be a postcard, a photo album, a recording, a book... I would ...
1vote
1answer
2kviews
Logging to database in ASP.NET Core Entity Framework Core application
I have an ASP.NET Core Entity Framework Core application and I want to implement my own custom logger. I don't want to use ready solutions like NLog or Serilog. I added a new class library project ("...
5votes
3answers
3kviews
Are methods a bad practice on .NET Core EF entity classes?
Say you have the following entity that represent an exact resource from a table, we're talking .NET Core with Entity Framework Core, code-first approach. public class Person { [Key] public ...
0votes
3answers
964views
Need advice on reporting with big amounts of data
I have a monolith application in .net core 3.0 with entity framework core 3.0. using: a table with ~3 million records. Its structure is BusinessUnitId | ProfileId | Amount(it has more fields, but ...
1vote
1answer
350views
Call library functions with varying number of inputs while keeping API simple
For a ASP.NET Core application, I'm using a library which performs calculations using objects that have a similar interface but their constructors use different inputs. The inputs are market prices ...
0votes
0answers
24views
how to work with variable data structures and templates
I need users to be able to create an organization which will have some preset fields such as Name, Address, and Type. But depending on the type, the organization can have type-specific fields such as ...
1vote
1answer
949views
Can I use Entity Framework with a SOAP API layer over a database?
We have a hierarchical database at our institution that has exposed a SOAP endpoint as the only way to make CRUD operations against it. We are primarily a .NET Core shop. I'm trying to conceptualize ...
34votes
5answers
34kviews
Should I check if something exists in the db and fail fast or wait for db exception
Having two classes: public class Parent { public int Id { get; set; } public int ChildId { get; set; } } public class Child { ... } When assigning ChildId to Parent should I check first if ...
2votes
1answer
2kviews
Entity Framework - extending OR injecting services into DB Context
I fear I'm asking a somewhat silly question, but I'm now completely lost as to which principle I should follow. To my understanding - in terms of Single Responsibility Principle it's best we don't ...